package edu.bit.water.util;

import java.util.List;

public class ListToSqlString {
    //将List<String>转换成sql语句中where-in后面的格式，比如("科学","计算机","技术")
    public static String toString(List<String> str){
        if(str.size()==0)
            return new String("()");

        StringBuilder temp = new StringBuilder();
        temp.append("(");
        for(int i =0 ;i<str.size()-1;i++){
            temp.append("'"+str.get(i)+"',");
        }
        temp.append("'"+str.get(str.size()-1)+"')");

        return  new String(temp);
    }
}
